import React from 'react'
import { ScaleS, ScaleT } from 'src/utils/ScreenUtil'
import { Text, View, StyleSheet } from 'react-native'
import PropTypes from 'prop-types'
import { getYearFromFullTime } from '../../utils/TimeUtil'
import { getDegreeLabelByLevel } from '../../utils/ConfigUtil'

export default function EducationInfoCardNew (props) {
  const { dataSource, style } = props
  return (
    <View style={{ ...styles.educationInfoItemView, ...style }}>
      <Text style={styles.educationInfoItemTitleLeft}>
        {`${getYearFromFullTime(dataSource.beginTime)}-${getYearFromFullTime(dataSource.endTime)}`} | {dataSource.schoolName}
      </Text>
      <Text style={styles.educationInfoItemTitleRight}>{getDegreeLabelByLevel(dataSource.degreeLevel)}·{dataSource.majorName}</Text>
    </View>
  )
}
EducationInfoCardNew.propTypes = {
  dataSource: PropTypes.object,
  style: PropTypes.object
}
EducationInfoCardNew.defaultProps = {
  dataSource: {}
}
const styles = StyleSheet.create({
  educationInfoItemView: {
    // width: ScaleS(335),
    // height: Platform.OS === 'ios' ? 'auto' : ScaleS(150)
    // height: ScaleS(150),
  },
  educationInfoItemTitleLeft: {
    color: '#000000',
    fontSize: ScaleT(15),
    fontWeight: '300',
    flex: 1,
    marginBottom: ScaleS(15)
  },
  educationInfoItemTitleRight: {
    color: '#3C3C3C',
    fontSize: ScaleT(14),
    fontWeight: '300'
  }
})
